import request from '@/config/axios'

export interface BrokerageWithdrawVO {
  id: number
  userId: number
  name: string
  accountNo: string
  bankName: string
  bankAddress: string
  accountQrCodeUrl: string
  status: number
  auditReason: string
  auditTime: Date
  remark: string
  no: string
  price: number
  feePrice: number
  totalPrice: number
  balance: number
  type: number
}

// 查询相亲佣金提现列表
export const getBrokerageWithdrawPage = async (params) => {
  return await request.get({ url: `/order/brokerage-record/page`, params })
}

// 查询相亲佣金提现详情
export const getBrokerageWithdraw = async (id: number) => {
  return await request.get({ url: `/order/brokerage-record/get?id=` + id })
}

// 查询相亲佣金提现详情
export const getWithdrawal = async (userId: number) => {
  return await request.get({ url: `/order/brokerage-record/getWithdrawal?userId=` + userId })
}

// 新增相亲佣金提现
export const createBrokerageWithdraw = async (data: BrokerageWithdrawVO) => {
  return await request.post({ url: `/order/brokerage-record/create`, data })
}

// 修改相亲佣金提现
export const updateBrokerageWithdraw = async (data: BrokerageWithdrawVO) => {
  return await request.put({ url: `/order/brokerage-record/update`, data })
}

// 删除相亲佣金提现
export const deleteBrokerageWithdraw = async (id: number) => {
  return await request.delete({ url: `/order/brokerage-record/delete?id=` + id })
}

// 导出相亲佣金提现 Excel
export const exportBrokerageWithdraw = async (params) => {
  return await request.download({ url: `/order/brokerage-record/export-excel`, params })
}
